import Vue from 'vue';
import VueRouter from 'vue-router';
import { routeImporter } from "./Importer";
// 解决：【VUE】Redirected when going from "/" to "/login" via a navigation guard.
const a = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return a.call(this, location, onResolve, onReject);
  return a.call(this, location).catch(err => err);
}

Vue.use(VueRouter);

export const routes = [...routeImporter.import()]
export const router = new VueRouter({ routes });
